package com.example.lol.ui;

import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;

import com.example.lol.R;
import com.example.lol.ui.adapter.HomeAdapter;
import com.example.lol.ui.adapter.NewsAdapter;
import com.example.lol.ui.base.BaseFragment;
import com.example.lol.ui.bean.NewBean;
import com.google.android.material.tabs.TabLayout;

import java.util.ArrayList;
import java.util.List;

public class FirstBottomFragment extends BaseFragment {

    private TabLayout mTabLayout;
    private ViewPager mViewPager;
    private HomeAdapter mVpAdapter;//viewpager 对应的adapter

    @Override
    protected void initArgumentData(Bundle arguments) {
        super.initArgumentData(arguments);
    }

    @Override
    protected int rootLayout() {
        return R.layout.demo_one;
    }

    @Override
    protected void initView(View view) {
        mTabLayout = view.findViewById(R.id.bottom_demo);
        mViewPager = view.findViewById(R.id.vp_content_1);
    }

    @Override
    protected void initData() {
        mVpAdapter = new HomeAdapter(getChildFragmentManager());
        mViewPager.setAdapter(mVpAdapter);
        mTabLayout.setupWithViewPager(mViewPager);
        mTabLayout.setInlineLabel(true);
    }

    @Override
    protected void bindEvent() {

    }


}